<?php

require_once(ISLANDS_PATH . '/Island/Generator/Php.php');

function smarty_function_island($params, &$smarty) {

	$lang = 'php';
	if(isset($params['lang']))
		$lang = $params['lang'];
		
	// TODO: Automatically build the classname based on the lang
	$islandGenerator = null;
	switch($lang)
	{
		case 'php':
			$islandGenerator = new CodeIslands_Island_Generator_Php();
			break;
		default:
			break;
	}
	
	return $islandGenerator->getIsland($params);
}